package com.ewzj.bigdata.mvp.ui.activity

import android.content.Intent
import android.support.v7.app.AppCompatActivity
import android.os.Bundle

import com.ewzj.bigdata.R
import com.ewzj.bigdata.di.component.DaggerFeedBackActivityComponent
import com.ewzj.bigdata.di.module.FeedBackActivityModule
import com.ewzj.bigdata.mvp.contract.FeedBackActivityContract
import com.ewzj.bigdata.mvp.presenter.FeedBackActivityPresenter
import com.jakewharton.rxbinding2.view.RxView
import com.jess.arms.base.BaseActivity
import com.jess.arms.di.component.AppComponent
import kotlinx.android.synthetic.main.activity_feed_back.*


class FeedBackActivity : BaseActivity<FeedBackActivityPresenter>() ,FeedBackActivityContract.View{
    override fun setupActivityComponent(appComponent: AppComponent?) {
        DaggerFeedBackActivityComponent.builder().appComponent(appComponent)
                .feedBackActivityModule(FeedBackActivityModule(this))
                .build().inject(this)

    }

    override fun initData(savedInstanceState: Bundle?) {
        tv_title.text="意见反馈"
        RxView.clicks(iv_back).subscribe({finish()})
        RxView.clicks(tv_send).subscribe({mPresenter.feedBack(et_mail.text.toString(),et_sugess.text.toString())})
    }

    override fun initView(savedInstanceState: Bundle?): Int {
        return R.layout.activity_feed_back
    }

    override fun showLoading() {
    }

    override fun launchActivity(intent: Intent?) {
    }

    override fun hideLoading() {
    }

    override fun killMyself() {
    }

    override fun showMessage(message: String?) {
    }


}
